public class Product {
    private String name;
    private int price;
    private int number;
    private int sum;

    public Product(String name, int price, int number) {
        this.name = name;
        this.price = price;
        this.number = number;
        this.sum = this.price * this.number;
    }

    @Override
    public String toString() {
        return "Product{" +
                "name='" + name + '\'' +
                ", price=" + price +
                ", number=" + number +
                ", sum=" + sum +
                '}';
    }
}
